package com.mrobuy.jdvc.entity;

import com.gavel.annotation.FieldMeta;
import com.gavel.annotation.TableMeta;
import com.gavel.database.SQLExecutor;

@TableMeta(name = "JD_ACCOUNT", title = "京东帐号")
public class JDAccount {


    /**
     * access_token : c5468e59bd6e43f78d93a47054cb4b1cnjhl
     * expires_in : 31536000
     * refresh_token : 8de22a552e2244488aca749b0af47f34jhnt
     * scope : CUST
     * open_id : 6c3MWBFqTx3O1Zly03x0onalsBj-YbkG6-ajkGltLpU
     * uid : 7342887756
     * time : 1605659339631
     * token_type : bearer
     * code : 0
     */

    @FieldMeta(name = "APPKEY", title = "APPKEY", length = 32, primary = true)
    private String appkey;

    @FieldMeta(name = "APPSECRET", title = "APPSECRET", length = 32)
    private String appsecret;

    @FieldMeta(name = "VCCODE", title = "店铺简码", length = 32)
    private String vccode;

    @FieldMeta(name = "NAME", title = "店铺名称", length = 32)
    private String name;

    @FieldMeta(name = "ACCESS_TOKEN", title = "TOKEN", length = 64)
    private String access_token;

    @FieldMeta(name = "EXPIRES_IN", title = "令牌有效时间") // , 单位秒
    private int expires_in;

    @FieldMeta(name = "REFRESH_TOKEN", title = "刷新TOKEN", length = 64) // 调用次数限制为 500次/月
    private String refresh_token;

    @FieldMeta(name = "SCOPE", title = "用户授权的作用域", length = 32) //  用户授权的作用域，使用逗号（,）分隔
    private String scope;

    @FieldMeta(name = "OPEN_ID", title = "授权用户唯一标识", length = 64) //  用户授权的作用域，使用逗号（,）分隔
    private String open_id;

    @FieldMeta(name = "UID", title = "用户标识", length = 64)
    private String uid;

    @FieldMeta(name = "TIME", title = "时间")
    private long time;

    @FieldMeta(name = "TOKEN_TYPE", title = "TOKEN类型", length = 32)
    private String token_type;

    @FieldMeta(name = "CODE", title = "响应码")
    private int code;

    @FieldMeta(name = "AUTOSYNC", title = "自动同步", length = 20)
    private String autoSync;

    public String getAppkey() {
        return appkey;
    }

    public void setAppkey(String appkey) {
        this.appkey = appkey;
    }

    public String getAppsecret() {
        return appsecret;
    }

    public void setAppsecret(String appsecret) {
        this.appsecret = appsecret;
    }

    public String getVccode() {
        return vccode;
    }

    public void setVccode(String vccode) {
        this.vccode = vccode;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAccess_token() {
        return access_token;
    }

    public void setAccess_token(String access_token) {
        this.access_token = access_token;
    }

    public int getExpires_in() {
        return expires_in;
    }

    public void setExpires_in(int expires_in) {
        this.expires_in = expires_in;
    }

    public String getRefresh_token() {
        return refresh_token;
    }

    public void setRefresh_token(String refresh_token) {
        this.refresh_token = refresh_token;
    }

    public String getScope() {
        return scope;
    }

    public void setScope(String scope) {
        this.scope = scope;
    }

    public String getOpen_id() {
        return open_id;
    }

    public void setOpen_id(String open_id) {
        this.open_id = open_id;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public String getToken_type() {
        return token_type;
    }

    public void setToken_type(String token_type) {
        this.token_type = token_type;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getAutoSync() {
        return autoSync;
    }

    public void setAutoSync(String autoSync) {
        this.autoSync = autoSync;
    }

    public static void main(String[] args) throws Exception {
        SQLExecutor.createTable(JDAccount.class);
    }

    @Override
    public String toString() {
        return "JDAccount{" +
                "appkey='" + appkey + '\'' +
                ", appsecret='" + appsecret + '\'' +
                ", vccode='" + vccode + '\'' +
                ", name='" + name + '\'' +
                ", access_token='" + access_token + '\'' +
                ", expires_in=" + expires_in +
                ", refresh_token='" + refresh_token + '\'' +
                ", scope='" + scope + '\'' +
                ", open_id='" + open_id + '\'' +
                ", uid='" + uid + '\'' +
                ", time=" + time +
                ", token_type='" + token_type + '\'' +
                ", code=" + code +
                '}';
    }
}
